package server.orders;

import java.util.Arrays;
import java.util.List;

import server.database.AbstractTable;
import server.database.DatabaseColumn;

public class LineInOrderTable extends AbstractTable
{
	public static final String TABLE_NAME = "Line_In_Order";

	public static final DatabaseColumn ORDER_ID = new DatabaseColumn("order_id", INTEGER, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn LINE_NUMBER = new DatabaseColumn("line_number", INTEGER, Arrays.asList(AUTO_INCREMENT));
	public static final DatabaseColumn PRODUCT_ID = new DatabaseColumn("product_id", INTEGER, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn QUANTITY = new DatabaseColumn("quantity", INTEGER, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn PRICE = new DatabaseColumn("price", FLOAT, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn STATUS = new DatabaseColumn("status", INTEGER, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn ESTIMATED_DELIVERY_DATE = new DatabaseColumn("estimated_delivery_date", DATE, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn COMMENTS = new DatabaseColumn("comments", STRING);

	public final List<DatabaseColumn> m_lstColumns = Arrays.asList(ORDER_ID, LINE_NUMBER, PRODUCT_ID, QUANTITY, PRICE, STATUS, ESTIMATED_DELIVERY_DATE, COMMENTS);
	public final List<DatabaseColumn> m_lstKey = Arrays.asList(LINE_NUMBER, ORDER_ID);

	@Override
	public String getTableName()
	{
		return TABLE_NAME;
	}

	@Override
	public List<DatabaseColumn> getColumns()
	{
		return m_lstColumns;
	}

	@Override
	public List<DatabaseColumn> getPrimaryKey()
	{
		return m_lstKey;
	}

	@Override
	public List<DatabaseColumn> getUniqueKey()
	{
		return null;
	}

}
